﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bank
{
    class Account
    {
        public int Id { get; set; }
        public double Money { get; set; }
        private List<Customer> listOfCustomers = new List<Customer>();
        Customer customer;

        public void GenerateCustomer(string firstName, string lastName, int id, double money)
        {
            customer = new Customer(firstName, lastName, id, money);
            listOfCustomers.Add(customer);
            Id = customer.AccountNumber;
            Money = customer.CurrentMoney;
        }

       
        public void PrintBalance()
        {
            Console.WriteLine("Account info:\nAccount id - {0}, Money balance - {1}.", Id, Money);
        }

        public void PrintFullAccountInfo()
        {
            customer.PrintCustomerInfoToConsole();
        }

        public void AddMoney(double moneyToAdd)
        {
            customer.CurrentMoney += moneyToAdd; 
        }

        public void TakeMoney(double moneyToTake)
        {
            if (customer.CurrentMoney >= moneyToTake)
            {
                customer.CurrentMoney -= moneyToTake;
            }
            else
            {
                Console.WriteLine("Not enough money.");
            }
        }

    }
}
